package shiqi.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import java.io.Serializable;

/**
 * @author geo_tsg
 * @version 1.0.0
 * @ClassName Demo.java
 * @Description
 * @createTime 2022-04-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
//一些表头基本配置
@ContentStyle(horizontalAlignment= HorizontalAlignment.CENTER)
@HeadStyle(horizontalAlignment= HorizontalAlignment.CENTER)
@ContentFontStyle(fontHeightInPoints=12)
@HeadFontStyle(fontHeightInPoints=12)
public class Demo implements Serializable {
    //第一行标题 因为相同，会合并单元格
    @ExcelProperty(index = 0, value = {"第一行标题","name1名称"})
    @ColumnWidth(16)
    private String name1;

    @ExcelProperty(index = 1, value = {"第一行标题","name2名称"})
    @ColumnWidth(8)
    private String name2;

}
